﻿<!-- This is a ResourceDictionary containing system invariant style for some controls.
By adding this resource dictionary somewhere in the object tree, the rendering of 
controls won't depend on the system.
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">


    <!--=================================================================
        Label
    ==================================================================-->
    <Style TargetType="{x:Type Label}">
        <Setter Property="Foreground"
                Value="Black"/>
        <Setter Property="Background"
                Value="Transparent"/>
        <Setter Property="Padding"
                Value="5"/>
        <Setter Property="HorizontalContentAlignment"
                Value="Left"/>
        <Setter Property="VerticalContentAlignment"
                Value="Top"/>
        <Setter Property="FontFamily"
                Value="Tahoma"/>
        <Setter Property="FontSize"
                Value="12pt"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Label}">
                    <Border Background="{TemplateBinding Background}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Padding="{TemplateBinding Padding}"
                            SnapsToDevicePixels="true">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="Foreground"
                                    Value="Gray"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

     <!--=================================================================
        TabControl
    ==================================================================-->
    <Style TargetType="{x:Type TabControl}">
        <Setter Property="Foreground"
                Value="White"/>
        <Setter Property="Background"
                Value="LightBlue"/>
        <Setter Property="BorderBrush"
                Value="Gray"/>
        <Setter Property="BorderThickness"
                Value="3"/>
        <Setter Property="Margin"
                Value="0"/>
        <Setter Property="Padding"
                Value="1"/>
        <Setter Property="MinWidth"
                Value="10"/>
        <Setter Property="MinHeight"
                Value="10"/>
        <Setter Property="HorizontalContentAlignment"
                Value="Center"/>
        <Setter Property="VerticalContentAlignment"
                Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local"
                          SnapsToDevicePixels="true"
                          ClipToBounds="true">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="ColumnDefinition0"/>
                            <ColumnDefinition x:Name="ColumnDefinition1"
                                              Width="0"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition x:Name="RowDefinition0"
                                           Height="Auto"/>
                            <RowDefinition x:Name="RowDefinition1"
                                           Height="*"/>
                        </Grid.RowDefinitions>
                        <TabPanel x:Name="HeaderPanel"
                                  Panel.ZIndex ="1" 
                                  KeyboardNavigation.TabIndex="1"
                                  Grid.Column="0"
                                  Grid.Row="0"
                                  Margin="2,2,2,0"
                                  IsItemsHost="true"
                                  Opacity="0"
                                  Background="Transparent"/>
                        <Grid x:Name="ContentPanel"
                              KeyboardNavigation.TabNavigation="Local"
                              KeyboardNavigation.DirectionalNavigation="Contained"
                              KeyboardNavigation.TabIndex="2"
                              Grid.Column="0"
                              Grid.Row="1">
                            <Decorator>
                                <ContentPresenter x:Name="PART_SelectedContentHost"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                  Margin="2,2,2,2"
                                                  ContentSource="SelectedContent"/>
                            </Decorator>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TabStripPlacement"
                                 Value="Bottom">
                            <Setter Property="Grid.Row"
                                    Value="1"
                                    TargetName="HeaderPanel"/>
                            <Setter Property="Grid.Row"
                                    Value="0"
                                    TargetName="ContentPanel"/>
                            <Setter Property="Height"
                                    Value="*"
                                    TargetName="RowDefinition0"/>
                            <Setter Property="Height"
                                    Value="Auto"
                                    TargetName="RowDefinition1"/>
                            <Setter Property="Margin"
                                    Value="2,0,2,2"
                                    TargetName="HeaderPanel"/>
                        </Trigger>
                        <Trigger Property="TabStripPlacement"
                                 Value="Left">
                            <Setter Property="Grid.Row"
                                    Value="0"
                                    TargetName="HeaderPanel"/>
                            <Setter Property="Grid.Row"
                                    Value="0"
                                    TargetName="ContentPanel"/>
                            <Setter Property="Grid.Column"
                                    Value="0"
                                    TargetName="HeaderPanel"/>
                            <Setter Property="Grid.Column"
                                    Value="1"
                                    TargetName="ContentPanel"/>
                            <Setter Property="Width"
                                    Value="Auto"
                                    TargetName="ColumnDefinition0"/>
                            <Setter Property="Width"
                                    Value="*"
                                    TargetName="ColumnDefinition1"/>
                            <Setter Property="Height"
                                    Value="*"
                                    TargetName="RowDefinition0"/>
                            <Setter Property="Height"
                                    Value="0"
                                    TargetName="RowDefinition1"/>
                            <Setter Property="Margin"
                                    Value="2,2,0,2"
                                    TargetName="HeaderPanel"/>
                        </Trigger>
                        <Trigger Property="TabStripPlacement"
                                 Value="Right">
                            <Setter Property="Grid.Row"
                                    Value="0"
                                    TargetName="HeaderPanel"/>
                            <Setter Property="Grid.Row"
                                    Value="0"
                                    TargetName="ContentPanel"/>
                            <Setter Property="Grid.Column"
                                    Value="1"
                                    TargetName="HeaderPanel"/>
                            <Setter Property="Grid.Column"
                                    Value="0"
                                    TargetName="ContentPanel"/>
                            <Setter Property="Width"
                                    Value="*"
                                    TargetName="ColumnDefinition0"/>
                            <Setter Property="Width"
                                    Value="Auto"
                                    TargetName="ColumnDefinition1"/>
                            <Setter Property="Height"
                                    Value="*"
                                    TargetName="RowDefinition0"/>
                            <Setter Property="Height"
                                    Value="0"
                                    TargetName="RowDefinition1"/>
                            <Setter Property="Margin"
                                    Value="0,2,2,2"
                                    TargetName="HeaderPanel"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" 
                                 Value="false">
                            <Setter Property="Foreground" 
                                    Value="Gray"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--=================================================================
        RadioButton
    ==================================================================-->
   <Style x:Key="{x:Type RadioButton}"
           TargetType="{x:Type RadioButton}">

        <Setter Property="Foreground"
                Value="Black"/>
        <Setter Property="Background"
                Value="White"/>
        <Setter Property="Padding"
                Value="2,0,0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <BulletDecorator>
                        <BulletDecorator.Bullet>
                                <Ellipse x:Name="Dot"
                                      Visibility="Visible"
                                      Fill="Black"
                                      Width="8"
                                      Height="8"/>
                        </BulletDecorator.Bullet>
                        <ContentPresenter Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="Center"
                                          HorizontalAlignment="Center"
                                          RecognizesAccessKey="True"
                                          TextBlock.Foreground="Black"
                                          TextBlock.FontSize="12"
                                          TextBlock.FontFamily="Arial"
                                         />
                    </BulletDecorator>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Expander}">
        <Setter Property="Foreground"
                Value="Blue"/>
        <Setter Property="Background"
                Value="Gray"/>
        <Setter Property="HorizontalContentAlignment"
                Value="Stretch"/>
        <Setter Property="VerticalContentAlignment"
                Value="Stretch"/>
        <Setter Property="BorderBrush"
                Value="Gray"/>
        <Setter Property="BorderThickness"
                Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Border 
                            CornerRadius="3"
                            SnapsToDevicePixels="true"
                            Background="Gray"
                            >
                        <DockPanel>
                            <Button x:Name="HeaderSite"
                                          DockPanel.Dock="Top"
                                          Margin="1"
                                          MinWidth="0"
                                          MinHeight="0"
                                          Content="{TemplateBinding Header}"
                                          ContentTemplate="{TemplateBinding HeaderTemplate}"
                                          ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                                          Foreground="Gray"
                                          FontFamily="Tahoma"
                                          FontSize="12pt"
                                          FontStyle="Normal"
                                          FontStretch="Medium"
                                          FontWeight="Medium"
                                          HorizontalContentAlignment="Stretch"
                                          VerticalContentAlignment="Stretch"
                                          Background="LightGray"
                                          />
                            <ContentPresenter x:Name="ExpandSite"
                                              DockPanel.Dock="Bottom"
                                              Visibility="Collapsed"
                                              Focusable="false"
                                              HorizontalAlignment="Stretch"
                                              VerticalAlignment="Stretch"
                                              />
                        </DockPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--=================================================================
        ItemsControl
    ==================================================================-->
    <Style TargetType="{x:Type ItemsControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ItemsControl}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}"
                            SnapsToDevicePixels="true">
                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

  <Style TargetType="ComboBoxItem" >
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="TextElement.Foreground" Value="Black"/>
    <Setter Property="TextElement.FontFamily" Value="Lucida Console"/>
    <Setter Property="TextElement.FontWeight" Value="Normal"/>
    <Setter Property="TextElement.FontStyle" Value="Normal"/>
    <Setter Property="TextElement.FontSize" Value="12"/>
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate TargetType="ComboBoxItem">
          <Border BorderThickness="1" Padding="3,0,3,0" BorderBrush="Black" Background="lightgray">
            <ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="true" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="ComboBox">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="TextElement.Foreground" Value="Black"/>
    <Setter Property="TextElement.FontFamily" Value="Lucida Console"/>
    <Setter Property="TextElement.FontWeight" Value="Normal"/>
    <Setter Property="TextElement.FontStyle" Value="Normal"/>
    <Setter Property="TextElement.FontSize" Value="12"/>
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate TargetType="ComboBox">
          <Grid Name="MainGrid" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="200" />
              <ColumnDefinition Width="16" MinWidth="16" />
            </Grid.ColumnDefinitions>
            <ToggleButton IsChecked="False" BorderBrush="Black" Background="LightGray" Grid.ColumnSpan="2">
              <ToggleButton.Style>
                <Style TargetType="ToggleButton">
                  <Setter Property="Control.Template">
                    <Setter.Value>
                      <ControlTemplate TargetType="ToggleButton">
                        <Border Background="LightGray" BorderBrush="Black" SnapsToDevicePixels="True">
                          <Grid Width="16" HorizontalAlignment="Right">
                            <Path Data="M0,0L3.5,4 7,0z" Fill="#FF000000" Margin="3,1,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" />
                          </Grid>
                        </Border>
                      </ControlTemplate>
                    </Setter.Value>
                  </Setter>
                </Style>
              </ToggleButton.Style>
            </ToggleButton>
            <ContentPresenter Content="{TemplateBinding ComboBox.SelectionBoxItem}" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="true" IsHitTestVisible="False" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="MenuItem">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="TextElement.Foreground" Value="Black"/>
    <Setter Property="TextElement.FontFamily" Value="Lucida Console"/>
    <Setter Property="TextElement.FontWeight" Value="Normal"/>
    <Setter Property="TextElement.FontStyle" Value="Normal"/>
    <Setter Property="TextElement.FontSize" Value="12"/>
    <Setter Property="Panel.Background">
      <Setter.Value>
        <SolidColorBrush>#00FFFFFF</SolidColorBrush>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="Menu">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Width" Value="300" />
    <Setter Property="Height" Value="100" />
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate TargetType="Menu">
          <Border BorderThickness="1" Padding="2" BorderBrush="Black" Background="#FFF6F6F6" SnapsToDevicePixels="True">
            <ItemsPresenter />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type Button}">
    <Setter Property="BorderBrush" Value="Black"/>
    <Setter Property="Width" Value="Auto"/>
    <Setter Property="Height" Value="Auto"/>
    <Setter Property="Foreground" Value="Black"/>
    <Setter Property="Background" Value="LightGray"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate>
          <Border Background="{TemplateBinding Background}" BorderThickness="1" BorderBrush="{TemplateBinding Foreground}">
            <ContentPresenter
                Content="{TemplateBinding Button.Content}"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontSize="12"
                TextBlock.FontFamily="Arial"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Margin="3"/>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="Button.IsMouseOver" Value="true">
        <Setter Property = "Background" Value="#fbb117"/>
      </Trigger>
      <Trigger Property="Button.IsPressed" Value="true">
        <Setter Property = "Background" Value="#90fbb117 "/>
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style TargetType="ListBoxItem" >
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="TextElement.Foreground" Value="Black"/>
    <Setter Property="TextElement.FontFamily" Value="Lucida Console"/>
    <Setter Property="TextElement.FontWeight" Value="Normal"/>
    <Setter Property="TextElement.FontStyle" Value="Normal"/>
    <Setter Property="TextElement.FontSize" Value="12"/>
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBoxItem">
          <Border Padding="2" Background="white">
            <ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="left" VerticalAlignment="Center" SnapsToDevicePixels="true" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="ListBox">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="TextElement.Foreground" Value="Black"/>
    <Setter Property="TextElement.FontFamily" Value="Lucida Console"/>
    <Setter Property="TextElement.FontWeight" Value="Normal"/>
    <Setter Property="TextElement.FontStyle" Value="Normal"/>
    <Setter Property="TextElement.FontSize" Value="12"/>
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBox">
          <Grid Name="MainGrid" SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="200" />
              <ColumnDefinition Width="16" MinWidth="16" />
            </Grid.ColumnDefinitions>
            <ScrollViewer HorizontalScrollBarVisibility="Disabled" CanContentScroll="true">
              <VirtualizingStackPanel IsItemsHost="true" HorizontalAlignment="center"/>
            </ScrollViewer>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBar_LineButtonUp" TargetType="{x:Type RepeatButton}">
    <Setter Property="Background" Value="LightGray"/>
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Grid Height="16" Width="16" >
            <Border Height="16" Width="16" Background="{TemplateBinding Background}">
              <Path Name="Path" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="DarkGray" Data="M 0 4 L 7 4 L 3.5 0 Z"  />
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBar_LineButtonDown" TargetType="{x:Type RepeatButton}">
    <Setter Property="Background" Value="LightGray"/>
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Grid Height="16" Width="16" >
            <Border Height="16" Width="16" Background="{TemplateBinding Background}">
              <Path Name="Path" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="DarkGray" Data="M 0 0 L 3.5 4 L 7 0 Z" />
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBar_LineButtonLeft" TargetType="{x:Type RepeatButton}">
    <Setter Property="Background" Value="LightGray"/>
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Grid Height="16" Width="16" >
            <Border Height="16" Width="16" Background="{TemplateBinding Background}">
              <Path Name="Path" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="DarkGray" Data="M 0 3.5 L 4 0 L 4 7 Z"/>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBar_LineButtonRight" TargetType="{x:Type RepeatButton}">
    <Setter Property="Background" Value="LightGray"/>
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Grid Height="16" Width="16" >
            <Border Height="16" Width="16" Background="{TemplateBinding Background}">
              <Path Name="Path" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="DarkGray" Data="M 0 0 L 4 3.5 L 0 7 Z" />
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBar_PageButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Rectangle Fill="Transparent" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ScrollBar_Thumb" TargetType="{x:Type Thumb}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Grid>
            <Border Background="DarkGray" CornerRadius="1" Margin="2" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type ScrollBar}">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Background" Value="LightGray" />
    <Setter Property="Width" Value="16" />
    <Setter Property="MinWidth" Value="16" />
    <Setter Property="Height" Value="Auto" />
    <Setter Property="MinHeight" Value="0" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ScrollBar}">
          <Grid>
            <Grid.RowDefinitions>
              <RowDefinition Height="16" />
              <RowDefinition Height="*"/>
              <RowDefinition Height="16" />
            </Grid.RowDefinitions>

            <RepeatButton Grid.Row="0" 
                          Style="{DynamicResource ScrollBar_LineButtonUp}"
                          Command="ScrollBar.LineUpCommand" />

            <Border Grid.Row="1" 
                    Background="{TemplateBinding Background}" />

            <Track Grid.Row="1" Name="PART_Track" IsDirectionReversed="true">
              <Track.DecreaseRepeatButton>
                <RepeatButton>
                  <RepeatButton.Style>
                    <Style BasedOn="{StaticResource ScrollBar_PageButton}" TargetType="{x:Type RepeatButton}">
                      <Setter Property="Command" Value="ScrollBar.PageUpCommand" />
                    </Style>
                  </RepeatButton.Style>
                </RepeatButton>
              </Track.DecreaseRepeatButton>
              <Track.Thumb>
                <Thumb>
                  <Thumb.Style>
                    <Style BasedOn="{StaticResource ScrollBar_Thumb}" TargetType="{x:Type Thumb}">
                      <Setter Property="MinHeight" Value="4" />
                    </Style>
                  </Thumb.Style>
                </Thumb>
              </Track.Thumb>
              <Track.IncreaseRepeatButton>
                <RepeatButton>
                  <RepeatButton.Style>
                    <Style BasedOn="{StaticResource ScrollBar_PageButton}" TargetType="{x:Type RepeatButton}">
                      <Setter Property="Command" Value="ScrollBar.PageDownCommand" />
                    </Style>
                  </RepeatButton.Style>
                </RepeatButton>
              </Track.IncreaseRepeatButton>
            </Track>

            <RepeatButton Grid.Row="2"
                          Style="{DynamicResource ScrollBar_LineButtonDown}"
                          Command="ScrollBar.LineDownCommand" />

          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="Width" Value="Auto" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="Height" Value="16" />
        <Setter Property="MinHeight" Value="16" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type ScrollBar}">
              <Grid Background="{TemplateBinding Background}">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="16" />
                  <ColumnDefinition Width="*"/>
                  <ColumnDefinition Width="16" />
                </Grid.ColumnDefinitions>

                <RepeatButton Grid.Column="0"
                              Style="{DynamicResource ScrollBar_LineButtonLeft}"
                              Command="ScrollBar.LineLeftCommand" />

                <Border Grid.Column="1"
                        Background="{TemplateBinding Background}" />

                <Track Grid.Column="1" Name="PART_Track" IsDirectionReversed="false">
                  <Track.DecreaseRepeatButton>
                    <RepeatButton>
                      <RepeatButton.Style>
                        <Style BasedOn="{StaticResource ScrollBar_PageButton}" TargetType="{x:Type RepeatButton}">
                          <Setter Property="Command" Value="ScrollBar.PageLeftCommand" />
                        </Style>
                      </RepeatButton.Style>
                    </RepeatButton>
                  </Track.DecreaseRepeatButton>
                  <Track.Thumb>
                    <Thumb>
                      <Thumb.Style>
                        <Style BasedOn="{StaticResource ScrollBar_Thumb}" TargetType="{x:Type Thumb}">
                          <Setter Property="MinWidth" Value="4" />
                        </Style>
                      </Thumb.Style>
                    </Thumb>
                  </Track.Thumb>
                  <Track.IncreaseRepeatButton>
                    <RepeatButton>
                      <RepeatButton.Style>
                        <Style BasedOn="{StaticResource ScrollBar_PageButton}" TargetType="{x:Type RepeatButton}">
                          <Setter Property="Command" Value="ScrollBar.PageRightCommand" />
                        </Style>
                      </RepeatButton.Style>
                    </RepeatButton>
                  </Track.IncreaseRepeatButton>
                </Track>

                <RepeatButton Grid.Column="2"
                              Style="{DynamicResource ScrollBar_LineButtonRight}"
                              Command="ScrollBar.LineRightCommand" />
              </Grid>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style TargetType="{x:Type ScrollViewer}">
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
    <Setter Property="VerticalScrollBarVisibility" Value="Visible" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate>
          <Grid Background="LightGray">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="*"/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <ScrollContentPresenter Grid.Row="0" Grid.Column="0" Content="{TemplateBinding ScrollViewer.Content}"/>

            <ScrollBar Orientation="Vertical" Grid.Row="0" Grid.Column="1" Name="PART_VerticalScrollBar"
              Minimum="0" Maximum="{TemplateBinding ScrollViewer.ScrollableHeight}" Value="{TemplateBinding ScrollViewer.VerticalOffset}" ViewportSize="{TemplateBinding ScrollViewer.ViewportHeight}" />
            <ScrollBar Orientation="Horizontal" Grid.Row="1" Grid.Column="0" Name="PART_HorizontalScrollBar"
              Minimum="0" Maximum="{TemplateBinding ScrollViewer.ScrollableWidth}" Value="{TemplateBinding ScrollViewer.HorizontalOffset}" ViewportSize="{TemplateBinding ScrollViewer.ViewportWidth}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="RichTextBox" >
    <Setter Property="OverridesDefaultStyle" Value="false" />
    <Setter Property="TextElement.Foreground" Value="Black"/>
    <Setter Property="TextElement.FontFamily" Value="Lucida Console"/>
    <Setter Property="TextElement.FontWeight" Value="Normal"/>
    <Setter Property="TextElement.FontStyle" Value="Normal"/>
    <Setter Property="TextElement.FontSize" Value="12"/>
    <Setter Property="Background" Value="lightgray"/>
    <Setter Property="BorderThickness" Value="0"/>
  </Style>
  
  <Style TargetType="TextBox" >
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="TextElement.Foreground" Value="Black"/>
    <Setter Property="TextElement.FontFamily" Value="Lucida Console"/>
    <Setter Property="TextElement.FontWeight" Value="Normal"/>
    <Setter Property="TextElement.FontStyle" Value="Normal"/>
    <Setter Property="TextElement.FontSize" Value="12"/>
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate TargetType="TextBoxBase">
          <Border Background="LightGray" BorderBrush="Black" BorderThickness="1" Padding="5">
            <ScrollViewer Name="PART_ContentHost" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="TextBlock">
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="TextElement.Foreground" Value="Black"/>
    <Setter Property="TextElement.FontFamily" Value="Lucida Console"/>
    <Setter Property="TextElement.FontWeight" Value="Normal"/>
    <Setter Property="TextElement.FontStyle" Value="Normal"/>
    <Setter Property="TextElement.FontSize" Value="12"/>
  </Style>
  
  <!-- Page Viewer -->
  <Style TargetType="{x:Type FlowDocumentPageViewer}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type FlowDocumentPageViewer}">
          <AdornerDecorator ClipToBounds="True">
            <Grid >
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Border Grid.Column="0"
                      BorderBrush="{TemplateBinding BorderBrush}"
                      BorderThickness="{TemplateBinding BorderThickness}"
                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}">

                <DocumentPageView PageNumber="0"
                                  DocumentViewerBase.IsMasterPage="True"
                                  ClipToBounds="True"/>
              </Border>
            </Grid>
          </AdornerDecorator>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- Document ScrollViewer -->
  <Style TargetType="{x:Type FlowDocumentScrollViewer}">
    <Setter Property="VerticalScrollBarVisibility" Value="Hidden"/>
  </Style>

  <!-- Document Reader -->
  <Style TargetType="{x:Type FlowDocumentReader}">
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type FlowDocumentReader}">
          <DockPanel LastChildFill="True">
            <!-- Page Content -->
            <Grid>
              <Border Name="PART_ContentHost"
                      Margin="{TemplateBinding Padding}"
                      BorderBrush="{TemplateBinding BorderBrush}"
                      BorderThickness="{TemplateBinding BorderThickness}"
                      KeyboardNavigation.TabIndex="1"
                      KeyboardNavigation.TabNavigation="Local"
                      KeyboardNavigation.IsTabStop="False"/>
            </Grid>
          </DockPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


</ResourceDictionary>
